#include<stdio.h> 
#define isOverLength 0

int reverse(int x){
    long lRet = 0;
    while(0 != x)
    {
        lRet = lRet * 10 + x % 10;
        x = x / 10;
    }

    if((int)lRet != lRet)
    {
        return isOverLength;
    }

    return (int)lRet;
}
int main()
{
	int n=12345;
	int m=reverse(n);
	printf("%d",m); 
	return 0;
}

